(* Definizione Datatype per le Attività dei Servizi Web *)
type activity = 
    Zero
  | One
  | Action of string
  | Sequence of activity * activity
  | Repeat of activity
  | While of activity
  | If of activity * activity
  | Flow of activity * activity	
  | Pick of activity * activity

let mk_sequence a1 a2 = Sequence (a1, a2)
let mk_if a1 a2 = If (a1, a2)
let mk_flow a1 a2 = Flow (a1, a2)
let mk_pick a1 a2 = Pick (a1, a2)

let rec pp = 
  function
      Zero -> "Zero"
    | One -> "One"
    | Action(a) -> "Action(" ^ a ^ ")"
    | Sequence(a,b) -> "Sequence(" ^ (pp a) ^ ", " ^ (pp b) ^ ")" 
    | Repeat a -> "Repeat(" ^ pp a ^ ")"
    | While(a) -> "While(" ^ (pp a) ^ ")"
    | If(a,b) -> "If(" ^ (pp a) ^ ", " ^ (pp b) ^ ")"
    | Flow(a,b) -> "Flow(" ^ (pp a) ^ ", " ^ (pp b) ^ ")"
    | Pick(a,b) -> "Pick(" ^ (pp a) ^ ", " ^ (pp b) ^ ")"

